﻿@model iChip.Hotspots.Models.HotspotsModel
@{
    if (ViewBag.State == 1)
    {
        ViewBag.Title = "Cập nhật Hotspots";
    }
    else
    {
        ViewBag.Title = "Thêm mới Hotspots";
    }
    Layout = null;
}

@using (Html.BeginForm("AddHotspots", "Admin", FormMethod.Post, new { id = "formaddHotspots" }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary()
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
        <h4 class="modal-title">@ViewBag.Title</h4>
    </div>
    <div class="modal-body">
        <div class="row">
            <div class="col-md-12">
                <div class="form-horizontal">
                    <div class="form-body">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    @Html.Label("Hotspot Mac", new { @class = "col-md-12" })
                                    <div class="col-md-12">
                                        @Html.TextBoxFor(m => m.Hotspot_Mac, new {@class = "col-md-12 form-control", @placeholder="AA-BB-CC-DD"  })
                                    </div>, 
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    @Html.Label("Tên Hotspot", new { @class = "col-md-12" })
                                    <div class="col-md-12">
                                        @Html.TextBoxFor(m => m.Hotspot_Name, new { @class = "col-md-12 form-control", @placeholder = "Ví Dụ: Hotspot iChip 1" })
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    @Html.Label("Thuộc Miền", new { @class = "col-md-12" })
                                    <div class="col-md-12">
                                        @Html.DropDownListFor(m=>m.Hotspot_Region, Model.Hotspot_RegionList, new { @class = "form-control col-md-12" })
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    @Html.Label("Thành Phố", new { @class = "col-md-12" })
                                    <div class="col-md-12">                                   
                                        @Html.DropDownListFor(m => m.Hotspot_City, Model.Hotspot_CityList, new { @class = "form-control col-md-12" })
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    @Html.Label("Địa Chỉ", new { @class = "col-md-12" })
                                    <div class="col-md-12">
                                        @Html.TextBoxFor(m => m.Hotspot_Address, new { @class = "col-md-12 form-control", @placeholder = "Ví Dụ: 45 Trung Kính" })
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    @Html.Label("Loại Thiết Bị", new { @class = "col-md-12" })
                                    <div class="col-md-12">
                                        @Html.TextBoxFor(m => m.Hotspot_Type, new { @class = "col-md-12 form-control", @placeholder = "Ví Dụ: IWG60" })
                                    </div>
                                </div>
                            </div>
                        </div>                      
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    @Html.Label("Latitude", new { @class = "col-md-12" })
                                    <div class="col-md-12">
                                        @Html.TextBoxFor(m => m.Hotspot_Lat, new { @class = "col-md-12 form-control" })
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    @Html.Label("Longitude", new { @class = "col-md-12" })
                                    <div class="col-md-12">
                                        @Html.TextBoxFor(m => m.Hotspot_Long, new { @class = "col-md-12 form-control" })
                                    </div>
                                </div>
                            </div>
                            
                        </div>
                       
                        @Html.TextBoxFor(m => m.Hotspot_Location, new { @class = "col-md-12 form-control hidden", @placeholder = "Location" })   
                        @Html.TextBoxFor(m => m.Hotspot_Id, new { placeholder = "", @class = "form-control hidden", @readonly = true })
                       
                    </div>
                </div>
            </div>
        </div>
        @*<a class="btn green" data-toggle="modal" href="#stack2">Launch modal</a>*@
    </div>
    <div class="modal-footer">
        <button type="button" data-dismiss="modal" class="btn">Đóng</button>
        @if (ViewBag.State == 1)
        {
            <button type="submit" class="btn green" id="btEditHotspot">Cập nhật</button>
        }
        else
        {
            <button type="submit" class="btn green" id="btAddHotspot">Thêm mới</button>
        }

    </div>
}

